import streamlit as st

from ..utils import *

def set(k,v):
    st.session_state[k] = v
    
def get(k, default=None):
    if k not in st.session_state:
        return default
    return st.session_state[k]

def unset(k):
    if k in st.session_state:
        del st.session_state[k]

class SpkWorker:

    def __init__(self):
        print('[SpkWorker]: __init__')

    __steps__ = []

    def __at__(self, index):
        print(f'[SpkWorker]: __at__ {index}')
        return self.__steps__[index]
    
    __keywords__ = []

    def __do_clean__(self):
        print('[SpkWorker]: __do_clean__')
        for k in self.__keywords__:
            unset(k)

    def __do_work__(self):
        print('[SpkWorker]: __do_work__')
        pass
        